package edu.fim.data;

public class DatabaseSettings {

	private String driver;
	private String ip;
	private String port;
	private String schema;

	public DatabaseSettings(
			String driver,
			String ip,
			String port,
			String schema) {
		this.driver = driver;
		this.ip = ip;
		this.port = port;
		this.schema = schema;
	}

	public String getDriver() {
		return driver;
	}

	public void setDriver(String driver) {
		this.driver = driver;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public String getPort() {
		return port;
	}

	public void setPort(String port) {
		this.port = port;
	}

	public String getSchema() {
		return schema;
	}

	public void setSchema(String schema) {
		this.schema = schema;
	}
	
	public String buildUrl() {
		StringBuilder url = new StringBuilder();
        url.append(driver);
        url.append("://");
        url.append(ip);
        url.append(":");
        url.append(port);
        url.append("/");
        url.append(schema);
        return url.toString();
	}
}